package com.hqyj.paimaisys.web;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;

//异常处理器的注解： RestControllerAdvice
@RestControllerAdvice
public class PaimaiExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResponseResult<String> handleException(HttpServletRequest request, Exception e){
         e.printStackTrace();
         return ResponseResult.error(e.getMessage());
    }
}
